﻿
using Library.Logic.Constraints;
using Library.Logic.Inference;
using System;
using System.Linq.Expressions;
using System.Reflection;
using TRULE = System.Linq.Expressions.Expression<System.Func<System.Linq.IQueryable<System.Linq.Expressions.Expression>, System.Collections.Generic.IEnumerable<System.Collections.Generic.IEnumerable<System.Linq.Expressions.Expression>>>>;
using TEXPRESSION = System.Linq.Expressions.Expression;

namespace Library.Logic
{
    public static partial class Builtin
    {
        internal static class Reflection
        {
            internal static MethodInfo IEqualityComparer_Equals = typeof(System.Collections.IEqualityComparer).GetMethod("Equals", BindingFlags.Public | BindingFlags.Instance, Type.DefaultBinder, new Type[] { typeof(object), typeof(object) }, null);

            internal static MethodInfo Builtin_Exists_xer = typeof(Builtin).GetMethod("Exists", BindingFlags.Public | BindingFlags.Static, Type.DefaultBinder, new Type[] { typeof(IHasConstraintsReasonReadOnly), typeof(TEXPRESSION), typeof(IReasonerReadOnly<TEXPRESSION>) }, null);
            internal static MethodInfo Builtin_ForAll_xer = typeof(Builtin).GetMethod("ForAll", BindingFlags.Public | BindingFlags.Static, Type.DefaultBinder, new Type[] { typeof(IHasConstraintsReasonReadOnly), typeof(TEXPRESSION), typeof(IReasonerReadOnly<TEXPRESSION>) }, null);
            internal static MethodInfo Builtin_Unique_xer = typeof(Builtin).GetMethod("Unique", BindingFlags.Public | BindingFlags.Static, Type.DefaultBinder, new Type[] { typeof(IHasConstraintsReasonReadOnly), typeof(TEXPRESSION), typeof(IReasonerReadOnly<TEXPRESSION>) }, null);
        }
        internal static class Reflection<T>
        {
            internal static MethodInfo IHasValueRead_T_get_Value = typeof(IHasValueReadOnly<T>).GetProperty("Value").GetGetMethod();

//            internal static MethodInfo IContainer_T_Contains = typeof(Library.Collections.Generic.IContainer<T>).GetMethod("Contains");
//            internal static MethodInfo IContainerReason_T_Contains = typeof(Library.Collections.Specialized.IContainerReason<T>).GetMethod("Contains", new Type[] { typeof(T), typeof(IArgument).MakeByRefType() });
//            internal static MethodInfo IEqualityComparer_T_Equals = typeof(System.Collections.Generic.IEqualityComparer<T>).GetMethod("Equals", BindingFlags.Public | BindingFlags.Instance, Type.DefaultBinder, new Type[] { typeof(T), typeof(T) }, null);
        }
    }
}
